package com.demo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
@TableName("tb_team_profile")
public class TeamProfile {
    @TableId(value = "tp_id", type = IdType.AUTO)
    private Long tpId;
    @TableField(value = "tp_uid")
    private Long tpUid;
    @TableField(value = "tp_urealname")
    private String tpUrealname;
    @TableField(value = "tp_team_name")
    private String tpTeamName;
    @TableField(value = "tp_project_name")
    private String tpProjectName;
    @TableField(value = "tp_recruit_total_number")
    private Integer tpNeedStudentNumber;//招募学生人数
    @TableField(value = "tp_member_number")
    private Integer tpMemberNumber;//现有学生人数
    @TableField(value = "tp_lack_student_number")
    private Integer tpDifference;//缺少学生人数
    @TableField(value = "tp_teacher_number")
    private Integer tpTeacherNumber;//教师人数
    @TableField(value = "tp_registration_deadline")
    private Date tpRegistrationDeadline;
    @TableField(value = "tp_contact")
    private String tpContact;
    @TableField(value = "tp_team_intro")
    private String tpTeamIntro;
    @TableField(value = "tp_ability_need")
    private String tpAbilityNeed;
    @TableField(value = "tp_alive")
    private Integer tpAlive;
    @TableField(value = "tp_del_flag")
    private Integer tpDelFlag;


    public String getTpUrealname() {
        return tpUrealname == null ? null : tpUrealname.trim();
    }

    public String getTpTeamName() {
        return tpTeamName == null ? null : tpTeamName.trim();
    }

    public String getTpProjectName() {
        return tpProjectName == null ? null : tpProjectName.trim();
    }

    public String getTpContact() {
        return tpContact == null ? null : tpContact.trim();
    }

    public String getTpTeamIntro() {
        return tpTeamIntro == null ? null : tpTeamIntro.trim();
    }

    public String getTpAbilityNeed() {
        return tpAbilityNeed == null ? null : tpAbilityNeed.trim();
    }

    public Integer getTpDelFlag() {
        return tpDelFlag;
    }

    public void setTpDelFlag(Integer tpDelFlag) {
        this.tpDelFlag = tpDelFlag;
    }

    //    检验必要信息是否填写
    public boolean isQualified() {
//        这几个为非空字段，必填
//        当有字段为空时返回false，全填写完毕则返回true
        return tpTeamName != null && tpProjectName != null &&
                tpRegistrationDeadline != null && tpContact != null;
    }

}
